﻿<%@ Page Title="" Language="C#" MasterPageFile="~/user/User.master" AutoEventWireup="true"
    CodeFile="default.aspx.cs" Inherits="user_index" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<%@ Register Assembly="CollectionPager" Namespace="SiteUtils" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceSearch" runat="Server">
  <div style="float: right;margin-right: 30px;">
                <asp:Label ID="Label1" runat="server" Text="Search by"></asp:Label>
                <asp:DropDownList ID="drtextsearch" runat="server">
                    <asp:ListItem>Name</asp:ListItem>
                    <asp:ListItem>ID</asp:ListItem>
                    <asp:ListItem>Price</asp:ListItem>
                </asp:DropDownList>
                <asp:TextBox ID="txtSearch" runat="server"></asp:TextBox>
                <asp:ImageButton ID="imgSearch"
                runat="server" ImageUrl="~/images/search_icon.gif" ImageAlign="AbsBottom" 
                    onclick="imgSearch_Click" />
            </div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="Server">   
    <asp:DataList ID="dtListProduct" runat="server" RepeatColumns="1">
        <ItemTemplate>
            <div id="viewproduct">
                <div class="colleft">
                    <asp:Image ID="imageProduct" runat="server" ImageUrl='<%#Eval("pd_image")%>' Width="150"
                        Height="150" />
                </div>
                <div class="colright">
                    <asp:Label ID="Label1" runat="server" Text='<%#Eval("pd_name") %>' Font-Bold="True"></asp:Label>
                    <br />
                    <asp:Label ID="Label2" runat="server" Text='<%#Eval("pd_description") %>'></asp:Label>
                    <br />
                    <br />
                    <asp:Label ID="Label5" runat="server" Text="Price:" ForeColor="#CC0000"></asp:Label><asp:Label ID="Label3" runat="server" Text='<%#String.Format("{0:0,0}",Eval("pd_price")) %>'></asp:Label><asp:Label
                        ID="Label4" runat="server" Text="$"></asp:Label>
                </div>
                
                <div class="addcart">
                    <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/images/add_to_shopping_cart.png" oncommand="ImageButton1_Command" CommandArgument='<%#Eval("pd_id")%>' CommandName="AddToCart" />
                </div>
            </div>

        </ItemTemplate>
    </asp:DataList>
    <br />
    <div>
        <cc1:CollectionPager ID="ClPageProduct" runat="server" MaxPages="5" PageSize="8"
            ResultsFormat="Display: {0}-{1} (of {2})" 
            ResultsStyle="margin-left: 20px;" ControlCssClass="CollectionPager"
            LabelText="Page:" PageNumbersDisplay="Numbers" ResultsLocation="None" ShowFirstLast="True"
            SliderSize="5" FirstText="First" LabelStyle="margin-left: 20px;" 
            BackNextDisplay="Buttons" BackNextButtonStyle="" 
            BackNextStyle="margin: 10px;" 
            ControlStyle="border: 1px solid #666;margin: 5px;" PagingMode="QueryString">
        </cc1:CollectionPager>
    </div>
    
</asp:Content>